package com.example.kaoqinmanager.activity;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.example.kaoqinmanager.R;
import com.example.kaoqinmanager.base.BaseBindingActivity;
import com.example.kaoqinmanager.databinding.ActivitySplashBinding;

public class SplashActivity extends BaseBindingActivity<ActivitySplashBinding> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActionBar supportActionBar = getSupportActionBar();
        supportActionBar.hide();

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (mSharePreferenceUtil.getIsLogin()) {
                    startActivity(new Intent(SplashActivity.this, MainActivity.class));
                } else {
                    startActivity(new Intent(SplashActivity.this, LoginActivity.class));
                }

                finish();
            }
        }, 2 * 1000);

    }
}